home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 2003 #3 / K-CD-3-2003.ISO / WinXP Service Pack 1 / xpsp1_sv_x86.exe / mstsc.ch_ / mstsc.chm / shared.js < prev   
Encoding:
JavaScript  |  2002-08-01  |  64.2 KB  |  1,697 lines

  1. // Filename: shared.js
  2. // Version shared.js for Whistler
  3. // version post b1
  4.  
  5. //************************************************ Shared components path setting *****************************************
  6. //*******************************************************************************************************************
  7. //  ALWAYS PUT THE NAME OF THE CHM THAT WILL CONTAIN shared.js WHERE YOU SEE ntshared.chm
  8. //  IN LINE TWELVE.     ie:  var sSharedCHM= moniker+"ntshared.chm::/";
  9. //  
  10.  
  11.  var moniker= "ms-its:";                           
  12.  var sSharedCHM= moniker+"mstsc.chm::/";
  13.  
  14. //  var moniker= "";                  // moniker= ""; for flat files
  15. //  var sSharedCHM= moniker+"";
  16.  
  17. //************************************************ EVENT HANDLING ********************************************
  18. //*******************************************************************************************************************
  19. //  re-directs to the proper event-driven functions.
  20.  
  21. window.onload= loadPage;
  22. document.onclick= onclickTriage;
  23. document.onmouseover= gettingHot;
  24. document.onmouseout= gettingCold;
  25. window.onunload=saveChecklistState;
  26. window.onresize= resizeDiv;
  27.  
  28. window.onbeforeprint = set_to_print;
  29. window.onafterprint = reset_form;
  30.         
  31. //********************************************  USER-DEFINED GLOBAL VARIABLES  ************************************
  32. //********************************************************************************************************************
  33. //  The images listed below can all be changed by the user.
  34.  
  35. var sShortcutTip= "";
  36.  
  37. var gifwithin = false;
  38.  
  39.   
  40.     xmldoc = new ActiveXObject("microsoft.XMLDOM");
  41.     xmldoc.async = false;
  42.     xmldoc.load(sSharedCHM + "alttext.xml");
  43.  
  44.     var Alt_sPreviousTip= xmldoc.getElementsByTagName("sPreviousTip")
  45.     var Alt_sNextTip= xmldoc.getElementsByTagName("sNextTip")
  46.     var Alt_sExpandTip= xmldoc.getElementsByTagName("sExpandTip")
  47.     var Alt_sPopupTip= xmldoc.getElementsByTagName("sPopupTip")
  48.         var hld_path2reuse= xmldoc.getElementsByTagName("path2reuse")
  49.     var hld_path2glossary= xmldoc.getElementsByTagName("path2glossary")
  50.     var hld_rel_gif = xmldoc.getElementsByTagName("reltopgif")
  51.     var hld_chmName = xmldoc.getElementsByTagName("chmName")
  52.     var hld_emailer = xmldoc.getElementsByTagName("emailer")
  53.     var hld_sendtext = xmldoc.getElementsByTagName("sendtext")
  54.     var hld_sendto = xmldoc.getElementsByTagName("sendto")
  55.  
  56. //<SMARTHELP>
  57.  
  58.    var defaultStartMode;
  59.    var defaultCPanelMode;
  60.    var smartErrorTextNode;
  61.    var smartErrorText;
  62.    var xmldocSKUSettings;
  63.  
  64.    // Grab the ALTTEXT.XML enteries for smart span classes.
  65.    // Get SKU specific defaults.
  66.    var defaultSKUSettingsURL = xmldoc.documentElement.selectSingleNode("smartreusabletext");
  67.    if (defaultSKUSettingsURL != null) {
  68.       if (defaultSKUSettingsURL.text == sSharedCHM + "alttext.xml") {
  69.           xmldocSKUSettings = xmldoc;
  70.       } else {
  71.          xmldocSKUSettings = new ActiveXObject("microsoft.XMLDOM");
  72.          xmldocSKUSettings.async = false;
  73.          xmldocSKUSettings.load(defaultSKUSettingsURL.text);
  74.       }
  75.       if (xmldocSKUSettings.documentElement != null) {
  76.          defaultStartMode = xmldocSKUSettings.documentElement.selectSingleNode("smartstartdefault");
  77.          defaultCPanelMode = xmldocSKUSettings.documentElement.selectSingleNode("smartcpaneldefault");
  78.          smartErrorTextNode = xmldocSKUSettings.documentElement.selectSingleNode("smarterrortext");
  79.          smartErrorText = smartErrorTextNode ? smartErrorTextNode.text : "XOXOX";
  80.       }
  81.    } // (defaultSKUSettingsURL != NULL)
  82.  
  83. //</SMARTHELP>
  84.     
  85.     var sPreviousTip="" + Alt_sPreviousTip.item(0).nodeTypedValue
  86.     var sNextTip="" + Alt_sNextTip.item(0).nodeTypedValue
  87.     var sExpandTip="" + Alt_sExpandTip.item(0).nodeTypedValue
  88.     var sPopupTip="" + Alt_sPopupTip.item(0).nodeTypedValue
  89.     var path2reuse="" + hld_path2reuse.item(0).nodeTypedValue
  90.     var path2glossary="" + hld_path2glossary.item(0).nodeTypedValue
  91.     var rel_gif="" + hld_rel_gif.item(0).nodeTypedValue
  92.     var chmName="" + hld_chmName.item(0).nodeTypedValue+"::/"
  93.     var emailer="" + hld_emailer.item(0).nodeTypedValue
  94.     var sendtext="" + hld_sendtext.item(0).nodeTypedValue
  95.     var sendto="" + hld_sendto.item(0).nodeTypedValue
  96.     
  97.    var xmldom = new ActiveXObject("microsoft.XMLDOM");
  98.     xmldom.async = false;
  99.         
  100. var closed = sSharedCHM + "plusCold.gif";            //image used for collapsed item in callExpand()
  101. var closedHot = sSharedCHM + "plusHot.gif";            //hot image used for collapsed item in callExpand()
  102. var expand = sSharedCHM + "minusCold.gif";            //image used for expanded item in callExpand()
  103. var expandHot = sSharedCHM + "minusHot.gif";        //hot image used for expanded item in callExpand()
  104.  
  105. var previousCold= sSharedCHM + "previousCold.gif";
  106. var previousHot= sSharedCHM + "previousHot.gif"; 
  107. var nextCold= sSharedCHM + "nextCold.gif";
  108. var nextHot= sSharedCHM + "nextHot.gif"; 
  109.  
  110. var shortcutCold= sSharedCHM + "shortcutCold.gif";
  111. var shortcutHot= sSharedCHM + "shortcutHot.gif";
  112.  
  113. var popupCold= sSharedCHM + "popupCold.gif";
  114. var popupHot= sSharedCHM + "popupHot.gif";
  115.  
  116. var emptyImg= sSharedCHM + "empty.gif";            //image used for empty expand
  117. var noteImg= sSharedCHM + "note.gif";            //image used for notes
  118. var tipImg= sSharedCHM + "tip.gif";                //image used for tips
  119. var warningImg= sSharedCHM + "warning.gif";        //image used for warnings
  120. var cautionImg= sSharedCHM + "caution.gif";        //image used for cautions
  121. var importantImg= sSharedCHM + "important.gif";        //image used for important notice
  122. var relTopicsImg= sSharedCHM + "rel_top.gif";        //image used for important notice
  123.  
  124. var branchImg= sSharedCHM + "elle.gif";
  125. var branchImg_RTL= sSharedCHM + "elle_rtl.gif";
  126.  
  127.  
  128. //********************************************  GLOBAL VARIABLES  ******************************************
  129. //********************************************************************************************************
  130.  
  131. var joejoe = false;
  132. var printing = "FALSE";
  133. var single = "FALSE";
  134. var scroller = "FALSE";
  135. var valet = "FALSE";
  136. var isRTL= (document.dir=="rtl");
  137. var imgStyleRTL= ""; 
  138.       if (isRTL) imgStyleRTL=" style='filter:flipH' ";
  139.  
  140.  
  141. var sActX_TDC= "CLASSID='CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83'";        //Tabular Data Control  for  reusable text data
  142. var sSharedReusableTextFile= sSharedCHM + "reusable.xml";                    // common reusable text file
  143. var sSharedReusableTextFileRecord= "para";                                    //reusable text record
  144.  
  145. var numbers= /\d/g;                //javascript regular expression
  146. var spaces= /\s/g;                //javascript regular expression
  147. var semicolon= /;/g;            //javascript regular expression
  148.  
  149. var isIE5 = (navigator.appVersion.indexOf("MSIE 5")>0) || (navigator.appVersion.indexOf("MSIE")>0 && parseInt(navigator.appVersion)> 4);
  150. var isIE55 = (navigator.appVersion.indexOf("MSIE 5.5")>0);
  151. var isIE6 = (navigator.appVersion.indexOf("MSIE 6")>0);
  152.  
  153. var isPersistent= false;
  154.  
  155. //********************************************  INITIALIZATION  *************************************************
  156. //******************************************************************************************************************
  157. function list_them(){
  158.         
  159.     var envelope = sSharedCHM +'envelope.gif';
  160.     var server = "<DIV Class='FeedbackBar'><SPAN Class='webOnly'><IMG  SRC=" + envelope + " ALT='' BORDER='0'></SPAN><SPAN Class='webOnly' Style='position:relative; top:-1; left:1; color:#333333;'> " + sendtext + " "; 
  161.     server += "<a href='mailto:" + sendto + "?subject=HELP: ";
  162.     server += document.title + "'";
  163.     server += ">" + sendto + "</a></SPAN></DIV>";
  164.     
  165.     var i;
  166.  
  167.     for (i=0; i < document.all.length; i++){
  168.         if ((document.all[i].tagName == "P") ||
  169.             (document.all[i].tagName == "H1")||
  170.             (document.all[i].tagName == "H6")){
  171.             document.all[i].outerHTML = server + document.all[i].outerHTML;
  172.             i = document.all.length;
  173.             }
  174.         }
  175. }
  176. //*** loadPage **********************************************************************************************
  177. //  Adds the default image tags and re-usable text to the HTML page.
  178.  
  179. function loadPage(){
  180. if (printing == "TRUE") return;
  181.  
  182. if (emailer == "yes" ) list_them();
  183.  
  184. isPersistent= (document.all.item("checklist")!=null) && ((isIE5) || (isIE6));
  185.  
  186.   setPreviousNext();
  187.   
  188.   resizeDiv();
  189.   if (isPersistent) getChecklistState();
  190.   addReusableText();
  191.   insertImages();
  192. }
  193.  
  194. //****** setPreviousNext  ************************************************************************ ********************************************************************************************* 
  195. // insert previous/next navbar
  196. // called by: <div id="nav">@@HTMLsequenceFile.txt or .lst@@</div>
  197.  
  198. function setPreviousNext(){
  199.  
  200.  
  201.   var oNav = document.all.item("nav");
  202.         if (oNav == null ) return;
  203.   
  204.   var sPreviousALT= sPreviousTip;
  205.   var sNextALT= sNextTip;
  206.   var sHTMLfile= oNav.innerHTML;
  207.  
  208.   var imgPrev= "<IMG SRC='"+previousCold+"' BORDER=0 ALT='"+ sPreviousALT +"' ALIGN='top' "+ imgStyleRTL +">";
  209.   var imgNext= "<IMG SRC='"+nextCold+"' BORDER=0 ALT='"+ sNextALT  + "' ALIGN='top' "+ imgStyleRTL +">";
  210.   
  211.   var previousNextObject= "<OBJECT ID='HTMlist' WIDTH=100 HEIGHT=51 " + sActX_TDC +"><param name='DataURL' value='"
  212.         +sHTMLfile +"'><param name='UseHeader' value=True></OBJECT>";
  213.       
  214.         oNav.innerHTML= "<TABLE WIDTH='100%' STYLE='margin-top:0;' cellspacing=0>"
  215.         + "<TR><TD style='text-align=left; background-color:transparent'><A ID='previousLink' HREF='#' REL='previous' CLASS='navbar'>"
  216.         +imgPrev + "</A></TD><TD width='100%' align='center'></td><TD style='text-align=right; background-color:transparent'><A ID='nextLink' HREF='#' REL='next' CLASS='navbar'>"
  217.         +imgNext+ "</A></TD></TR></TABLE>";
  218.                     
  219.       document.body.innerHTML= document.body.innerHTML +  previousNextObject;
  220.       findPageSeq();
  221.       if (printing == "TRUE") return;
  222.       var  thisLoc= document.location.href +"#";
  223.  
  224.       if (previousLink.href== thisLoc) previousLink.style.display="none";
  225.       else  previousLink.style.display="block";
  226.  
  227.       if (nextLink.href== thisLoc) nextLink.style.display="none";
  228.       else  nextLink.style.display="block";
  229.       
  230. }
  231.  
  232. function findPageSeq() {
  233.  
  234. var rs= HTMlist.recordset;
  235. var thisLoc= document.location.href;
  236. var iLoc= thisLoc.lastIndexOf("/");
  237.  
  238.     if (iLoc > 0) thisLoc= thisLoc.substring(iLoc+1, thisLoc.length);
  239.     
  240.     
  241.     if (nav.style == "[object]") {
  242.                 nav.style.visibility="hidden";
  243.                 printing = "FALSE";
  244.                 }
  245.         else
  246.             {
  247.                 printing = "TRUE";
  248.                 return;
  249.             }
  250.     
  251.        
  252.     rs.moveFirst();
  253.        
  254.     while (!rs.EOF) {
  255.           if (thisLoc == rs.fields("HTMfiles").value){
  256.               nav.style.visibility="visible"; 
  257.                 rs.MoveNext();
  258.               break;
  259.           }
  260.           previousLink.href=rs.fields("HTMfiles").value;      
  261.           rs.moveNext();
  262.      }
  263.                 
  264.       if (!rs.EOF) nextLink.href=rs.fields("HTMfiles").value;
  265. }
  266.     
  267. //******Re-usable text ********************************************************************************************* 
  268. // Inserts the Tabular Data Control (TDC) object at the end of the page 
  269. // Inserts "re-usable text" from the txt file at: <span id="@@CHM_name@@@@index#@@" class="reuse"></span>
  270. // e.g.<span id="printing4" class="reuse"></span> for record#4 in the printing.txt in printing.chm.
  271.  
  272. //function addReusableText(){
  273. //var ntsharedAdded= false;                    // make sure the object is only added once
  274. //var CHMspecificAdded= false;                // make sure the object is only added once
  275. //var coll = document.all.tags("SPAN");
  276. //var sIndex,sRecord,sFile,sFileID,dataBindingObject;
  277. //var loaded = false;
  278.     
  279. //    xsldoc = new ActiveXObject("microsoft.XMLDOM");
  280. //    xmldoc = new ActiveXObject("microsoft.XMLDOM");
  281. //    xmldoc.async = false;
  282.         
  283. //     for (var i=0; i< coll.length; i++)                                   
  284. //         if (coll[i].className.toLowerCase()=="reuse"){
  285.     //         if (isRTL) coll[i].dir= "rtl";
  286.     //         
  287.     //         if (coll[i].id == null) return;
  288.              
  289.        //         sFile= coll[i].id.toLowerCase();
  290.              
  291.         //     sFileID= sFile;
  292.         //     var sText = "X";
  293.         //     var o = 0;    
  294.         //    xmldoc.load(path2reuse + "reusable.xml");
  295.         //    xsldoc.load(path2reuse + "formatter.xsl");
  296.         //    node = xmldoc.selectSingleNode("glossary/glossSection/entry[@entryID='" + sFileID + "']");
  297.         //    if(node!=null){
  298.         //        alert("hhh")
  299.         //        sText = " " + node.transformNode(xsldoc);
  300.         //        }
  301.         //    coll[i].innerHTML= sText;
  302. //    }           
  303. //}
  304.  
  305.  
  306.  
  307. // <SMARTREUSABLETEXT>
  308.  
  309. // addReusableText() - called during document load to find all references
  310. // render time bound <SPAN> contents.  Extracts content resources from reusable.xml.
  311. //
  312. // "class" names bound (reuse, smart)
  313. // "reuse" static lookup of commonly referred to text.
  314. // "smart" dynamic lookup of navigation text relevent 
  315. //         to the shell presentation of the start menu 
  316. //         and the control panel, (simple and classic), for the logged on user.
  317. //         Requires inserting custom <OBJECT> supported by Help and Support Services viewer.
  318. //         Currently not available from HTML Help control. 2000/01/12.
  319. //
  320. function addReusableText(){
  321.  
  322.    var coll = document.all.tags("SPAN");
  323.    var xmlLoaded = false;
  324.    var control = null;
  325.    var thisID;
  326.    var strKey;
  327.    var text;
  328.  
  329.    // original error text
  330.    text = "X";
  331.  
  332.    //<SMARTREUSABLETEXT>
  333.    //queried state of shell presentation for start menu and control panel.
  334.    var menuSimple = false;
  335.    var controlSimple = false;
  336.  
  337.    // holds calculated lookup suffixes for smart class items.
  338.    var strSuffixStartMenuOnly = "";
  339.    var strSuffixStartMenuAndControlPanel = "";
  340.  
  341.    // smart class UserSettings Interface classid
  342.    var sActX_PCHealth = "CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7";
  343.  
  344.    // smart class lookup suffixes per shell presentation mode.
  345.    // TODO: Findout where these constants are best documented.
  346.    var strMenuClassic =   "_smclassic";
  347.    var strMenuSimple =    "_smsimple";
  348.    var strCPanelClassic = "_cpclassic";
  349.    var strCPanelSimple =  "_cpsimple";
  350.  
  351.    // only attempt to query once per rendering
  352.    var bPresentationModeQueried = false;
  353.    //</SMARTREUSABLETEXT>
  354.  
  355.    // Check every span in the document.
  356.    for (var i=0; i< coll.length; i++) {
  357.  
  358.       var thisSpan = coll[i];
  359.       var spanClass = thisSpan.className.toLowerCase();
  360.       if (spanClass == "reuse" || spanClass == "smart") {
  361.          if (isRTL) thisSpan.dir = "rtl";
  362.          if (thisSpan.id == null) break;
  363.  
  364.          // strKey is the key we'll use to look up the replaceable text in the XML file
  365.          strKey = thisSpan.id.toLowerCase();
  366.          if (!xmlLoaded) {
  367.  
  368.             xmldoc = new ActiveXObject("microsoft.XMLDOM");
  369.  
  370.             // Init Properties
  371.             xmldoc.async = false;
  372.             xmldoc.validateOnParse = false; // improve perf
  373.             xmldoc.resolveExternals = false;
  374.             xmldoc.preserveWhiteSpace = false;
  375.  
  376.             // Load Document
  377.             xmldoc.load(path2reuse + "reusable.xml");
  378.             if (xmldoc == null || xmldoc.documentElement == null) return;     // couldn't open reusable.xml
  379.             xmlLoaded = true;
  380.          }
  381.  
  382.          // skip smart tags when defaults are not present
  383.          if ((defaultSKUSettingsURL != null) && (xmldocSKUSettings.documentElement != null)) {
  384.             if (spanClass == "smart") {
  385.  
  386.                // Query Presentation Mode once per rendering.
  387.                if (!bPresentationModeQueried) {
  388.  
  389.                   bPresentationModeQueried=true;
  390.  
  391.                   // Set To Defaults
  392.                   if (defaultStartMode != null) {
  393.                      menuSimple = (defaultStartMode.text == strMenuSimple);
  394.                   } else {
  395.                      menuSimple = true;
  396.                   }
  397.  
  398.                   if (defaultCPanelMode != null) {
  399.                      controlSimple = (defaultCPanelMode.text == strCPanelSimple);
  400.                   } else {
  401.                      controlSimple = true;
  402.                   }
  403.            
  404.                   // Create Helper Object
  405.                   // NOTE: this COM Interface is only exposed from HSS.
  406.                   try {
  407.                      var obj = window.document.createElement("OBJECT");
  408.                      objLoaded = true;    
  409.                      obj.width = 1;
  410.                      obj.height = 1;
  411.                      obj = document.body.insertAdjacentElement("beforeEnd", obj)
  412.                      obj.id = "pchealth";
  413.                      obj.onerror = "smarthelperror";
  414.                      obj.classid = sActX_PCHealth;
  415.                   }
  416.                   catch (e) {
  417.                      // HTMLHelp throws returns this on whistler
  418.                      if (e instanceof Error && e.number == -2147220999) {
  419.                         obj.removeNode(true);
  420.                      } else {
  421.                         throw(e);
  422.                      }
  423.                   }
  424.  
  425.                   // Get the current user's presentation settings
  426.                   // Attempt to read smart help values from system
  427.                   var test = window.document.all("pchealth");
  428.                   if (test != null) {
  429.                      if (test.UserSettings != null) {
  430.                         try {
  431.                            menuSimple = test.UserSettings.IsStartPanelOn; 
  432.                            try {
  433.                               controlSimple = test.UserSettings.IsWebViewBarricadeOn;
  434.                            }
  435.                            catch(e) {
  436.                               controlSimple = (defaultCPanelMode.text == strCPanelSimple);
  437.                            }
  438.                         }
  439.                         catch (e) {
  440.                            menuSimple = (defaultStartMode.text == strMenuSimple);
  441.                         }
  442.                      }
  443.                  }// (test != null)
  444.  
  445.               }// (!bPresentationModeQueried)
  446.  
  447.               // get the error text to display
  448.               text = smartErrorText;
  449.  
  450.               // Build key suffixes. One for start menu only and one for start menu and control panel.
  451.               strSuffixStartMenuOnly = (menuSimple ? strMenuSimple : strMenuClassic);
  452.               strSuffixStartMenuAndControlPanel = strSuffixStartMenuOnly + (controlSimple ? strCPanelSimple : strCPanelClassic);
  453.  
  454.               // The actual key could have either strSuffixStartMenuOnly or strSuffixStartMenuAndControlPanel suffixes.
  455.               // strSuffixStartMenuAndControlPanel has precedence over strSuffixStartMenuOnly
  456.               strKey = strKey + strSuffixStartMenuAndControlPanel;
  457.  
  458.             }//if (spanClass == "smart")
  459.  
  460.          }// ((defaultSKUSettingsURL != null) && (xmldocSKUSettings.documentElement != null))
  461.  
  462.          // Lookup XML node containing reference
  463.          var strNodeSelector = "glossSection/entry[@entryID='" + strKey + "']/scopeDef/def";
  464.          var node = xmldoc.documentElement.selectSingleNode(strNodeSelector);
  465.  
  466.          // if we haven't found the node yet, try the other suffix if this is a smart span
  467.          if (node == null && spanClass == "smart" && (defaultSKUSettingsURL != null) && (xmldocSKUSettings.documentElement != null)) {
  468.             // one more try--use the other suffix
  469.             strKey = thisSpan.id.toLowerCase() + strSuffixStartMenuOnly;
  470.             strNodeSelector = "glossSection/entry[@entryID='" + strKey + "']/scopeDef/def";
  471.             node = xmldoc.documentElement.selectSingleNode(strNodeSelector);
  472.          }
  473.  
  474.  
  475.          // okay, we found the node, get the text
  476.          if (node != null) {
  477.             // replace the span's contents with the reusable text
  478.             thisSpan.innerHTML = node.text;
  479.          } else {
  480.             // set appropriate error text
  481.             if (spanClass == "smart" && (defaultSKUSettingsURL != null) && (xmldocSKUSettings.documentElement != null)) {
  482.                thisSpan.innerHTML = smartErrorText;
  483.             } else {
  484.                thisSpan.innerHTML = text;
  485.             }
  486.          }
  487.  
  488.       } // if (spanClass == "reuse" || spanClass == "smart")
  489.    }// for
  490.  
  491. }// addReusableText()
  492. // <SMARTREUSABLETEXT>
  493.  
  494.  
  495.  
  496.  //****** insertImages ********************************************************************************************* 
  497.  //  Inserts shared images in User-Defined Variables section and thumbnails.
  498. var booking = false;
  499. function insertImages(){
  500. if (printing == "FALSE") booking = true;
  501. if (printing == "TRUE" && booking == true ) {
  502.     booking = false;
  503.     return;
  504.     }
  505.  
  506.  
  507. // insert alert icons
  508.   var collP = document.all.tags("P");
  509.   
  510.   for (var i=0; i<collP.length; i++) {
  511.        if (collP[i].className.toLowerCase()=="note")            collP[i].innerHTML ="<img class='alert' src='"+noteImg+"' "+ imgStyleRTL +"> " +     collP[i].innerHTML;
  512.        else if (collP[i].className.toLowerCase()=="warning")    collP[i].innerHTML ="<img class='alert' src='"+warningImg+"'> " +  collP[i].innerHTML;
  513.        else if (collP[i].className.toLowerCase()=="caution")    collP[i].innerHTML ="<img class='alert' src='"+cautionImg+"'> " +  collP[i].innerHTML;
  514.        else if (collP[i].className.toLowerCase()=="tip")        collP[i].innerHTML ="<img class='alert' src='"+tipImg+"'> " +      collP[i].innerHTML;
  515.        else if (collP[i].className.toLowerCase()=="important")  collP[i].innerHTML ="<img class='alert' src='"+importantImg+"'> " + collP[i].innerHTML;
  516.        else if (collP[i].className.toLowerCase()=="empty")      collP[i].innerHTML ="<img class='alert' src='"+emptyImg+"'> " +    collP[i].innerHTML;
  517.        if (collP[i].className.toLowerCase()=="reltopics" && rel_gif == "yes")  {
  518.             collP[i].outerHTML ="<img class='relTopics' src='"+relTopicsImg+"'> " + collP[i].outerHTML;
  519.             }   
  520.           }
  521.   
  522.  
  523.  
  524. //indents for Navigation Tree 
  525. var collUL = document.all.tags("UL");
  526. if (printing != "TRUE") {
  527. for (var i=0; i<collUL.length; i++) {
  528.        var indent= 0;
  529.        if (collUL[i].className.toLowerCase()=="navtree"){
  530.            if (isRTL) collUL[i].style.listStyleImage= "url('" + branchImg_RTL + "')";
  531.            else collUL[i].style.listStyleImage= "url('" + branchImg + "')";
  532.              for (var j = 0; j < collUL[i].children.length; j++)
  533.                 if (collUL[i].children[j].className.toLowerCase()=="branch"){
  534.                     if (isRTL) collUL[i].children[j].style.marginRight= (indent +'em');
  535.                     else   collUL[i].children[j].style.marginLeft= (indent +'em');
  536.                     indent= indent + 0.75;
  537.                 }
  538.       }
  539. }
  540. }
  541.    
  542.   for (var i=0; i < document.anchors.length; i++){
  543.          var imgInsert="";  
  544.          var imgStyle= "";
  545.          var imgSpace= "<span class='space'></span>";      
  546.          var oBefore=document.anchors[i].parentElement.tagName;
  547.          var oAnchor= document.anchors[i].id.toLowerCase();
  548.          
  549. // insert RELTOPICS icons
  550.     if (rel_gif == "yes"){
  551.        if (oAnchor=="reltopics")
  552.                if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "reltopics")
  553.                     imgInsert= "";    // not to re-insert when persistent
  554.             else  imgInsert= "<img class='relTopics' src='"+relTopicsImg+"'>" + imgSpace;
  555.         }
  556.         
  557. // insert SHORTCUT icons
  558.        if (oAnchor=="shortcut") {    
  559.             document.anchors[i].title= sShortcutTip;     
  560.             if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "shortcut")
  561.                     imgInsert= "";    // not to re-insert when persistent
  562.             else  imgInsert= "<img class='shortcut' src='"+shortcutCold+"' "+ imgStyleRTL+ ">" + imgSpace;
  563.         }    
  564.                       
  565. // insert POPUP icons
  566.        else if (oAnchor=="wpopup" || oAnchor=="wpopupweb") document.anchors[i].title= sPopupTip;
  567.        else if (document.anchors[i].className.toLowerCase()=="popupicon")
  568.             if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "popup")
  569.                    imgInsert= "";    // not to re-insert when persistent
  570.             else imgInsert= "<img class='popup' src='"+popupCold+"'>" + imgSpace;
  571.  
  572. // insert EXPAND icons 
  573.        else if (oAnchor=="expand") {
  574.               document.anchors[i].title= sExpandTip;
  575.               if (document.anchors[i].children.tags("IMG")(0) && document.anchors[i].children.tags("IMG")(0).className.toLowerCase() == "expand")
  576.                   imgInsert= "";     // not to re-insert when persistent      
  577.               else{ 
  578.                   if (document.anchors[i].parentElement.offsetLeft == document.anchors[i].offsetLeft) {
  579.                       imgSpace= "<span class='space' style='width:0'></span>";     
  580.                       if (isRTL){ document.anchors[i].parentElement.style.marginRight= "1.5em";  imgStyle=" style=margin-right:'-1.5em'";}
  581.                       else { document.anchors[i].parentElement.style.marginLeft= "1.5em";  imgStyle=" style=margin-left:'-1.5em'";}
  582.                   }      
  583.                   imgInsert= "<img class='expand' src='"+ closed +"' "+imgStyle+">" +imgSpace;
  584.               }
  585.        }
  586.  
  587.  
  588.  
  589. // insert thumbnail images       
  590.        else if (oAnchor=="thumbnail"  || oAnchor=="thumbnailweb"){ 
  591.             var sAltText = document.anchors[i].innerHTML;
  592.             gifwithin = true;
  593.             var sThumbnailText = document.anchors[i].title; 
  594.             var oImg = document.anchors[i].href.toLowerCase();
  595.                   if (oAnchor=="thumbnail") 
  596.                          var sThumbnailImg= getURL(oImg);
  597.                   else var sThumbnailImg = document.anchors[i].href.toLowerCase();
  598.                   
  599.                  found = sAltText.indexOf("BACKGROUND-COLOR:")
  600.             if (found != -1) {
  601.                 stop_p = sAltText.indexOf(">");
  602.                 sAltText = sAltText.substring(stop_p + 1, sAltText.length);
  603.                 stop_p = sAltText.indexOf("</FONT>");
  604.                 Highlighted = sAltText.substring(0,stop_p)
  605.                 sAltText = Highlighted + sAltText.substring(stop_p + 7, sAltText.length);
  606.                 }
  607.  
  608.                   
  609.                 document.anchors[i].outerHTML = "<DIV id='thumbDiv' class='thumbnail'>"+document.anchors[i].outerHTML+"</div>";
  610.                 document.anchors[i].innerHTML = "<img class='thumbnail' src='" + sThumbnailImg + "' alt= ' " + sAltText + "'><p>" +sThumbnailText+"</p>";
  611.                 
  612.                   if (isRTL) thumbDiv.style.styleFloat= "right";
  613.            }
  614.            
  615.         
  616.         
  617.         document.anchors[i].innerHTML = imgInsert + document.anchors[i].innerHTML;
  618.        if (isRTL) document.anchors[i].dir="rtl";
  619.    }
  620. }
  621.  
  622.  
  623. //***** onclickTriage ****************************************************************************************
  624. // redirects to the appropriate function based on the ID of the clicked <A> tag.
  625.  
  626. function onclickTriage(){
  627. var e= window.event.srcElement;
  628.  
  629. //  if the innerHTML in the <a> tag is encapsulated by a style tag or hightlighted in the word seach,
  630. //  the parentElement is called.
  631.  
  632.     if (printing == "TRUE") {
  633.         printing = "FALSE";
  634.          reset_form();
  635.         }
  636.         
  637.     for (var i=0; i < 5; i++)
  638.            if (e.tagName!="A" && e.parentElement!=null) e= e.parentElement;
  639.     eID= e.id.toLowerCase();
  640.                 
  641.     if (popupOpen) closePopup();
  642.     
  643. // expand image in a new window
  644.     if (eID=="thumbnail" || eID=="pophtm") popNewWindow(e);
  645.     else if (eID=="thumbnailweb") callThumbnailWeb(e);
  646.     else if (eID=="wpopup")    callPopup(e);
  647.     else if (eID=="wpopupweb") callPopupWeb(e);
  648.     else if (eID=="shortcut")  callShortcut(e);
  649.     else if (eID=="reltopics") callRelatedTopics(e);
  650.     else if (eID=="altloc")    callAltLocation(e);
  651.     else if (eID=="expand")    callExpand(e);
  652. // added to support Randy's Quad method code
  653.     else QuadDocumentClick()
  654. // ******************************
  655. }
  656.  
  657.  
  658. //*** gettingHot ****************************************************************************************
  659. // Makes all the required changes for mouseover.
  660.  
  661. function gettingHot() {
  662. var e = window.event.srcElement;
  663.     
  664. // Added to support Quad Method   **************************
  665.     if (e != null && e.firstChild != null && 
  666.         e.firstChild.tagName != null &&
  667.         e.firstChild.tagName.toLowerCase() == "input" && 
  668.         e.firstChild.type.toLowerCase() == "radio" && 
  669.         e.parentElement.className != "indentGray"){
  670.             QuadDocumentMouseOver()
  671.             }
  672.  
  673. // *****************************
  674.  
  675.   if (e.id.toLowerCase()=="cold")  e.id ="hot";
  676.   else if (e.src== previousCold)  e.src = previousHot;
  677.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== previousCold)  e.children.tags("IMG")(0).src= previousHot;
  678.   else if (e.src== nextCold)  e.src = nextHot;
  679.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== nextCold)  e.children.tags("IMG")(0).src= nextHot;
  680.   
  681.   else if (e.className.toLowerCase()=="shortcut" && e.tagName=="IMG")  e.src = shortcutHot;            //<img> tags have a class
  682.   else if (e.id.toLowerCase()=="shortcut")  e.children.tags("IMG")(0).src = shortcutHot;            //<a> tags have an ID
  683.   
  684.   else if (e.className.toLowerCase()=="popup" && e.tagName=="IMG")  e.src = popupHot;            //<img> tags have a class
  685.   else if (e.className.toLowerCase()=="popupicon")  e.children.tags("IMG")(0).src = popupHot;            //<a> tags have an ID
  686.   
  687.   else if ((e.className.toLowerCase()=="expand" && e.tagName=="IMG") ||( e.id.toLowerCase()=="expand")) expandGoesHot(e);
  688.  
  689. }
  690.  
  691. //*** gettingCold **************************************************************************************
  692. // Initial state for mouseout.
  693.  
  694. function gettingCold() {
  695. var e = window.event.srcElement;
  696.  
  697. // Added to support Quad Method   **************************
  698.     if (e != null && e.firstChild != null && 
  699.         e.firstChild.tagName != null &&
  700.         e.firstChild.tagName.toLowerCase() == "input" && 
  701.         e.firstChild.type.toLowerCase() == "radio" && 
  702.         e.parentElement.className != "indentGray"){
  703.             QuadDocumentMouseOver()
  704.             }
  705.  
  706. // *****************************
  707.  
  708.   if (e.id.toLowerCase()=="hot")  e.id ="cold";
  709.   else if (e.src== previousHot)  e.src = previousCold;
  710.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== previousHot)  e.children.tags("IMG")(0).src= previousCold;
  711.   else if (e.src== nextHot)  e.src = nextCold;
  712.   else if (e.className.toLowerCase()=="navbar" && e.children.tags("IMG")(0).src== nextHot)  e.children.tags("IMG")(0).src= nextCold;
  713.   
  714.   else if (e.className.toLowerCase()=="shortcut" && e.tagName=="IMG")   e.src = shortcutCold;        //<img> tags have a class
  715.   else if (e.id.toLowerCase()=="shortcut")  e.children.tags("IMG")(0).src= shortcutCold;             //<a> tags have an ID
  716.   
  717.   else if (e.className.toLowerCase()=="popup" && e.tagName=="IMG")   e.src = popupCold;        //<img> tags have a class
  718.   else if (e.className.toLowerCase()=="popupicon")  e.children.tags("IMG")(0).src= popupCold;             //<a> tags have an ID
  719.   
  720.   else if ((e.className.toLowerCase()=="expand" && e.tagName=="IMG") ||( e.id.toLowerCase()=="expand")) expandGoesCold(e);
  721. }
  722.  
  723. //****************************************** OBJECT CONSTRUCTION **************************************
  724. //*****************************************************************************************************
  725. //  Uses an A tag to pass parameters between an HTML page and this script.
  726. //  Creates an ActiveX Object from these parameters, appends the Object to the end of the page,
  727. //  and clicks it. These objects relate to HTMLHelp environment and information about them can be found on the http://HTMLHelp site.
  728.  
  729. //  Object construction variables *********************************************************************
  730.  
  731. var sParamCHM,sParamFILE, sParamEXEC, sParamMETA,iEND;
  732. var sActX_HH= " type='application/x-oleobject' classid='clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11' ";
  733.  
  734.  
  735. //*** callPopup ***************************************************************************************
  736. // creates an object from an <A> tag HREF, the object inserts a winhelp popup
  737. // called by: <A ID="wPopup" HREF="HELP=@@file_name.hlp@@ TOPIC=@@topic#@@">@@Popup text@@</A>
  738.  
  739. var joker = false;
  740. var blague = true;
  741.  
  742. function callPopup(eventSrc) {
  743. if (popupOpen) closePopup();
  744. var ntsharedAdded= false;                    // make sure the object is only added once
  745. var CHMspecificAdded= false;                // make sure the object is only added once
  746. var coll = document.all.tags("SPAN");
  747. var sIndex,sText=" ",sFile,sFileID,dataBindingObject;
  748.  
  749.      var e= eventSrc;
  750.      var eH= unescape(e);
  751.      eH = eH.toLowerCase();
  752.      var eH_= eH.toLowerCase();
  753.      
  754.      if(event){
  755.          event.returnValue = false;
  756.         }
  757.      found = false;
  758.                                                        
  759.        var iTOPIC = eH.lastIndexOf("topic=");
  760.      if (iTOPIC==-1) return;
  761.      sParamTOPIC = eH.substring((iTOPIC+6),eH.length);
  762.      
  763.      if (!joejoe){
  764.         xmldom.load(path2glossary + "glossary.xml");
  765.         joejoe = true;
  766.         }
  767.          
  768.         var o=0;
  769.         var node = "";    
  770.         node = xmldom.selectSingleNode("glossary/glossSection/entry[@entryID='" + sParamTOPIC + "']");
  771.                     
  772.                 if(node!=null)
  773.             {
  774.             
  775.             found = true;
  776.             var ralf = "";
  777.             ralf = node.getElementsByTagName("term")
  778.             sText = "<DIV CLASS='PopTerm'>" + ralf.item(0).nodeTypedValue + "</DIV>";
  779.             ralf = node.getElementsByTagName("para")
  780.             sText = sText + "<DIV CLASS='PopDef'>" + ralf.item(0).nodeTypedValue; + "</DIV>"
  781.             
  782.             look_at = xmldom.getElementsByTagName("glossary/locSection/locItem[@locItemID = 'SeeAlso']");        
  783.             
  784.             seealsos = node.getElementsByTagName("seeAlso");
  785.             var o=0;
  786.                 
  787.             while (o < seealsos.length){
  788.                 sIndex = seealsos.item(o).getAttribute("seeAlsoTermID");
  789.                 node = xmldom.selectSingleNode("glossary/glossSection/entry[@entryID='" + sIndex + "']");
  790.                 ralf = node.getElementsByTagName("term");
  791.                 sTerm = ralf.item(0).nodeTypedValue;
  792.                 if (o == 0) {
  793.                     sText = sText + "<DIV CLASS='PopSeeAlso'>" + look_at.item(0).nodeTypedValue + " "
  794.                     // sIndex = "<Input type=submit tabindex=1 value=hhhh onclick='jscript:alert(oPopup.sIndex.innerHTML)'>"
  795.                     sIndex = "<A ID='wPopup' HREF='HELP=glossary.hlp TOPIC=" + sIndex + "' TABINDEX='1'>" + sTerm + "</a>"
  796.                     }
  797.                 else
  798.                     {
  799.                     sIndex = ", <A ID='wPopup' HREF='HELP=glossary.hlp TOPIC=" + sIndex + "' TABINDEX='1'>" + sTerm + "</a>"
  800.                     }
  801.                 o++;
  802.                 sText = sText + sIndex 
  803.                 }
  804.                         
  805.             definition = xmldom.getElementsByTagName("glossary/locSection/locItem[@locItemID = 'See']");        
  806.             
  807.             seeentrys = node.getElementsByTagName("seeEntry");
  808.             var o=0;
  809.                 
  810.             while (o < seeentrys.length){
  811.                 sIndex = seeentrys.item(o).getAttribute("seeTermID");
  812.                 node = xmldom.selectSingleNode("glossary/glossSection/entry[@entryID='" + sIndex + "']");
  813.                 ralf = node.getElementsByTagName("term");
  814.                 sTerm = ralf.item(0).nodeTypedValue;
  815.                 if (o == 0) {
  816.                     sText = sText + "<DIV CLASS='PopSeeAlso'>" + definition.item(0).nodeTypedValue + " "
  817.                     // sIndex = "<Input type=submit tabindex=1 value=hhhh onclick='jscript:alert(oPopup.sIndex.innerHTML)'>"
  818.                     sIndex = "<A ID='wPopup' HREF='HELP=glossary.hlp TOPIC=" + sIndex + "' TABINDEX='1'>" + sTerm + "</a>"
  819.                     }
  820.                 else
  821.                     {
  822.                     sIndex = ", <A ID='wPopup' HREF='HELP=glossary.hlp TOPIC=" + sIndex + "' TABINDEX='1'>" + sTerm + "</a>"
  823.                     }
  824.                 o++;
  825.                 sText = sText + sIndex 
  826.                 }
  827.             }
  828.             
  829.             if ((isIE55 || isIE6) && found){
  830.                 var oPopup = false
  831.                 var oPopup = window.createPopup();
  832.                  var strScript = "<script language='JScript'> function clickPopup(){if (event.srcElement.tagName.toLowerCase() == 'a') parent.callPopup(event.srcElement.href); window.PopObject.hide(); return false;}</script>";
  833.                   var strDoc = oPopup.document.body.outerHTML.toLowerCase()
  834.                 
  835.                   oPopup.document.write(strDoc.replace("></body>", " onclick=\"clickPopup()\">" + strScript + "</body>"));
  836.                 //oPopup.document.write(strDoc.replace("></body>", " onclick=\"clickPopup()\, onkeypress=\"process_closePopup()\">" + strScript + "</body>"));
  837.                     oPopup.document.createStyleSheet(sSharedCHM + "coUA.css");    // Apply the stylesheet.
  838.                 var oPopBody = oPopup.document.body;
  839.                 
  840.                 //oPopBody.style.backgroundColor = '#FFFFCC';
  841.                 
  842.                   // oPopBody.style.border = "solid black 1px";
  843.                   oPopBody.style.margin = "0 0 0 0";
  844.                 if (isRTL) oPopBody.innerHTML = "<DIV DIR='RTL' class='XMLPopup'>" + sText + "</DIV>"           // need to add the style class here.
  845.                 else oPopBody.innerHTML = "<DIV class='XMLPopup'>" + sText + "</DIV>"
  846.                 if (window.event){
  847.                     joker = window.event.srcElement;
  848.                     }
  849.                 oPopup.show(0, 0, 400, 8, joker);    // Show the popup at an arbitrary size.
  850.                 var textSize = oPopBody.createTextRange();
  851.                 var wPop = textSize.boundingWidth + oPopBody.offsetWidth - oPopBody.clientWidth;    // Get the size of the text.
  852.                 var hPop = oPopBody.scrollHeight;
  853.                 oPopup.hide();
  854.                 oPopup.document.parentWindow.PopParent = window;
  855.                   oPopup.document.parentWindow.PopObject = oPopup;
  856.                 // oPopup.focus();
  857.                   oPopup.show(0, 1, wPop + 10, hPop, joker);
  858.                 //oPopup.document.focus(oPopup.document.body.JOKER);    
  859.                 return;
  860.                 }
  861.             
  862.             if (found){
  863.                 if (blague){
  864.                 document.body.insertAdjacentHTML("beforeEnd", "<DIV id='wPopupWeb' CLASS='popup'>" + sText + "</DIV>");
  865.                 blague = false;
  866.                 }
  867.                 window.wPopupWeb.innerHTML = sText;
  868.                 callPopupWeb(e);
  869.                 return;
  870.                 }
  871.                   
  872.    var iTOPIC = eH_.lastIndexOf("topic=");
  873.         if (iTOPIC==-1) return;
  874.         sParamTOPIC = eH.substring((iTOPIC+6),eH.length);          // extracts the topic for item2
  875.         
  876.   var iHELP = eH_.lastIndexOf("help=");
  877.         if (iHELP==-1) return;
  878.         sParamHELP = eH.substring(iHELP+5,iTOPIC);            // extracts the help file for item1
  879.         
  880.         if (document.hhPopup) document.hhPopup.outerHTML = "";    // if hhPopup object exists, clears it
  881.  
  882.  
  883.  var  h= "<object id='hhPopup'"+ sActX_HH + "STYLE='display:none'><param name='Command' value='WinHelp, Popup'>";
  884.       h= h + "<param name='Item1' value='" + sParamHELP + "'><param name='Item2' value='" + sParamTOPIC + "'></object>";
  885.         
  886.         document.body.insertAdjacentHTML("beforeEnd", h);     
  887.         document.hhPopup.hhclick();
  888. }
  889.  
  890.  
  891. //*** callAltLocation******************************************************************************
  892. // creates an object from an <A> tag HREF, the object will navigate to the alternate location if the first location is not found.
  893. // called from: <A ID="altLoc" HREF="CHM=@@1st_chm_name.chm;Alt_chm_name.chm@@  FILE=@@1st_file_name.htm;Alt_file_name.htm@@">@@Link text here@@</A>
  894.    
  895.  
  896. function callAltLocation(eventSrc) {
  897. var e= eventSrc;
  898. var eH= unescape(e.href);
  899. var eH_= eH.toLowerCase();
  900. var sFILEarray,sCHMarray;
  901.      event.returnValue = false;
  902.      
  903.   var sParamTXT= e.innerHTML;
  904.       sParamTXT= sParamTXT.replace(semicolon,"");
  905.                                        
  906.   var iFILE = eH_.lastIndexOf("file=");
  907.         if (iFILE==-1) return;
  908.         sParamFILE= eH.substring((iFILE+5),eH.length);                  // extracts the 2 HTM files
  909.         sParamFILE= sParamFILE.replace(spaces,"");
  910.         iSPLIT= sParamFILE.match(semicolon);
  911.         if (iSPLIT)
  912.               sFILEarray = sParamFILE.split(";");                                        // separates the 2 HTM files
  913.         else return;
  914.           
  915.   var iCHM  = eH_.lastIndexOf("chm=");
  916.         if(iCHM==-1) return;
  917.         else         sParamCHM = eH.substring(iCHM+4,iFILE);            // extracts the 2 CHM's
  918.         sParamCHM= sParamCHM.replace(spaces,"");
  919.         iSPLIT= sParamCHM.match(semicolon);
  920.         if (iSPLIT)
  921.             sCHMarray= sParamCHM.split(";");                                    // separates the 2 CHM's
  922.         else return;
  923.         
  924.         sParamFILE= moniker + sCHMarray[0]+ "::/" + sFILEarray[0] + ";" + moniker + sCHMarray[1]+ "::/" + sFILEarray[1];
  925.                 
  926.         if (document.hhAlt) document.hhAlt.outerHTML = "";                // if hhAlt object exists, clears it
  927.  
  928.  
  929.   var h= "<object id='hhAlt'"+ sActX_HH + "STYLE='display:none'><PARAM NAME='Command' VALUE='Related Topics'>";
  930.       h= h + "<param name='Item1' value='" + sParamTXT +";" + sParamFILE + "'></object>";
  931.     
  932.         document.body.insertAdjacentHTML("beforeEnd", h); 
  933.         document.hhAlt.hhclick();
  934. }
  935.  
  936.  
  937. //*** callRelatedTopics******************************************************************************
  938. // creates an object from an <A> tag HREF, the object inserts a popup of the related topics to select
  939. // called from: <A ID="relTopics" HREF="CHM=@@chm_name1.chm;chm_name2.chm@@ META=@@a_filename1;a_filename2@@">Related Topics</A>
  940.    
  941.  
  942. function callRelatedTopics(eventSrc) {
  943. var e= eventSrc;
  944. var eH= unescape(e.href);
  945. var eH_= eH.toLowerCase();
  946.      event.returnValue = false;
  947.                                        
  948.   var iMETA = eH_.lastIndexOf("meta=");
  949.         if (iMETA==-1) return;
  950.         sParamMETA = eH.substring((iMETA+5),eH.length);              // extracts the META keywords for item2
  951.         
  952.   var iCHM  = eH_.lastIndexOf("chm=");
  953.         if(iCHM==-1) sParamCHM = "";
  954.         else         sParamCHM = eH.substring(iCHM+4,iMETA);            // extracts the CHM files for item1
  955.     
  956.         if (document.hhRel) document.hhRel.outerHTML = "";            // if hhRel object exists, clears it
  957.  
  958.  
  959.   var h= "<object id='hhRel'"+ sActX_HH + "STYLE='display:none'><param name='Command' value='ALink,MENU'>";
  960.       h= h + "<param name='Item1' value='" + sParamCHM + "'><param name='Item2' value='" + sParamMETA + "'></object>";
  961.     
  962.         document.body.insertAdjacentHTML("beforeEnd", h);     
  963.         document.hhRel.hhclick();
  964. }
  965.  
  966. //*** popNewWindow***************************************************************************************
  967. // creates an object from an <A> tag HREF, the object then opens a new window from the image URL found in the HREF
  968. // called from: <a id="thumbnail" title="Enlarge figure" href="CHM=NTArt.chm FILE=@@image_name.gif@@">@@alt text here@@</A>
  969. // the thumbnail image is loaded by loadPage();
  970.  
  971.  
  972. function popNewWindow(eventSrc) {
  973. var eH= eventSrc.href;
  974.       event.returnValue = false;
  975.       
  976.  // extracts the thumbnail image URL from the <a> tag HREF
  977.     sParamFILE =  getURL(eH);
  978.     if (sParamFILE=="") return;
  979.  
  980. //    alert(sParamFILE);
  981.        
  982.  // if the hhWindow object exists, clears it
  983.     if (document.hhWindow) document.hhWindow.outerHTML = "";        
  984.         
  985. var  h =  "<object id='hhWindow'"+ sActX_HH +" STYLE='display:none'><param name='Command' value='Related Topics'>";
  986.      h = h + "<param name='Window' value='$global_largeart'><param name='Item1' value='$global_largeart;" + moniker + sParamFILE+ "'> </object>";
  987.     
  988.      document.body.insertAdjacentHTML("beforeEnd", h);
  989.      document.hhWindow.hhclick();
  990. }
  991.  
  992. //*** callShortcut ***************************************************************************************
  993. // creates an object from an <A> tag, the object then calls the executable code
  994. // called from: <A ID="shortcut" HREF="EXEC=@@executable_name.exe@@ CHM=ntshared.chm FILE=@@error_file_name.htm@@">@@Shortcut text@@</A>
  995. // the shortcut image is loaded by loadInitialImg();
  996.  
  997. function callShortcut(eventSrc) {
  998. var e= eventSrc;
  999. var eH= unescape(e.href);
  1000. var eH_= eH.toLowerCase();
  1001.  
  1002.     
  1003.  
  1004.     event.returnValue = false;
  1005.               
  1006.  // extracts the error file URL from the <a> tag HREF
  1007.     iEND= eH.length;
  1008.     sParamFILE =  getURL(eH);
  1009.     
  1010. var iEXEC = eH_.lastIndexOf("exec="); 
  1011.         if (iEXEC==-1) return;
  1012.         else sParamEXEC = eH.substring(iEXEC+5,iEND);                // extracts the executable for item1
  1013.         
  1014.         if (document.hhShortcut) document.hhShortcut.outerHTML = "";            // if the hhShortcut object exists, clears it
  1015.     
  1016. var  h =  "<object id='hhShortcut'"+ sActX_HH +" STYLE='display:none'> <param name='Command' value='ShortCut'>";
  1017.      if(sParamFILE != "") h = h + "<param name='Window' value='" + moniker + sParamFILE+ "'>";
  1018.      h = h + "<param name='Item1' value='" + sParamEXEC + "'><param name='Item2' value='msg,1,1'></object>";
  1019.  
  1020.         document.body.insertAdjacentHTML("beforeEnd", h);
  1021.         document.hhShortcut.hhclick();
  1022. }
  1023.  
  1024. //****************************************  EXPAND FUNCTIONS *********************************************************
  1025. //********************************************************************************************************************
  1026.  
  1027. //**  callExpand **************************************************************************************************
  1028. //  This expands & collapses (based on current state) "expandable" nodes as they are clicked.
  1029. //  Called by: <A ID="expand" href="#">@@Hot text@@</A>
  1030. //  Followed by:  <div class="expand">
  1031.  
  1032. function callExpand(eventSrc) {
  1033.  
  1034. var e= eventSrc;
  1035.     event.returnValue = false;                    // prevents navigating for <A> tag
  1036.     
  1037. var oExpandable = getExpandable(e); 
  1038. var oImg = getImage(e);
  1039.  
  1040.      if (oExpandable.style.display == "block")
  1041.           doCollapse(oExpandable, oImg);
  1042.      else doExpand(oExpandable, oImg);
  1043. }
  1044.  
  1045. //** expandGoesHot *********************************************************************************************
  1046. // Returns expand image to hot. 
  1047.  
  1048. function expandGoesHot(eventSrc){
  1049. var e= eventSrc;
  1050.     
  1051. var oExpandable = getExpandable(e);  
  1052. var oImg = getImage(e);
  1053.  
  1054.    if (oExpandable.style.display == "block") oImg.src = expandHot;
  1055.    else oImg.src = closedHot;
  1056. }
  1057.  
  1058.  
  1059. //** expandGoesCold *********************************************************************************************
  1060. // Returns expand image to cold.
  1061.  
  1062. function expandGoesCold(eventSrc){
  1063. var e= eventSrc;
  1064.  
  1065. var oExpandable = getExpandable(e);   
  1066. var oImg = getImage(e);
  1067.  
  1068.  if (oExpandable.style.display == "block") oImg.src = expand;
  1069.   else oImg.src = closed;
  1070.     
  1071. }
  1072.  
  1073.  
  1074. //** getExpandable *****************************[used by callExpand, expandGoesHot, expandGoesCold]*******
  1075. //  Determine if the element is an expandable node or a child of one.  
  1076.  
  1077. function getExpandable(eventSrc){
  1078. var  e = eventSrc;
  1079. var iNextTag, oExpandable;
  1080.     
  1081.        for (var i=1;i<4; i++){
  1082.                iNextTag=    e.sourceIndex+e.children.length+i;
  1083.               oExpandable= document.all(iNextTag);
  1084.               if (oExpandable.className.toLowerCase()=="expand" || iNextTag == document.all.length)
  1085.                    break;
  1086.        }
  1087.        return oExpandable;
  1088.        
  1089. }
  1090.  
  1091. //**  getImage ***********************************[used by callExpand, expandGoesHot, expandGoesCold]*******
  1092. //  Find the first image in the children of the current srcElement.   
  1093. // (allows the  image to be placed anywhere inside the <A HREF> tag)
  1094.  
  1095. function getImage(header) {
  1096. var oImg = header;
  1097.  
  1098.        if(oImg.tagName != "IMG") oImg=oImg.children.tags("IMG")(0);
  1099.        return oImg;
  1100. }
  1101.  
  1102.  
  1103. //****  expandAll *******************************************************************************************************
  1104. //  Will expand or collapse all "expandable" nodes when clicked. [calls closeAll()]
  1105. //  called by: <A HREF="#" onclick="expandAll();">expand all</A>
  1106.  
  1107. var stateExpand = false;    //applies to the page 
  1108.  
  1109. //**** ****************************************************************************************************************
  1110.  
  1111. function expandAll() {
  1112. var oExpandToggle, oImg;
  1113. var expandAllMsg = "expand all";                    //message returned when CloseAll() is invoked
  1114. var closeAllMsg = "close all";                        //message returned when ExpandAll() is invoked
  1115. var e= window.event.srcElement;
  1116.        event.returnValue = false;
  1117.  
  1118.        for (var i=0; i< document.anchors.length; i++){
  1119.                oExpandToggle = document.anchors[i];
  1120.          
  1121.                 if (oExpandToggle.id.toLowerCase() == "expand"){ 
  1122.                      oExpandable = getExpandable(oExpandToggle);  
  1123.                      oImg = getImage(oExpandToggle);
  1124.              
  1125.                      if (stateExpand == true) doCollapse(oExpandable, oImg);
  1126.                      else                     doExpand(oExpandable, oImg);
  1127.                 }
  1128.        }
  1129.        if (stateExpand == true) {
  1130.             stateExpand = false;
  1131.             e.innerText= expandAllMsg;
  1132.        }
  1133.        else {
  1134.             stateExpand = true;
  1135.             e.innerText= closeAllMsg;
  1136.        }
  1137. }
  1138.  
  1139.  
  1140. //****  doExpand *******************************************************************************************************
  1141. //  Expands expandable block & changes image
  1142.     
  1143. var redo = false;    
  1144. function doExpand(oToExpand, oToChange) {
  1145. var oExpandable= oToExpand;
  1146. var oImg= oToChange;
  1147.  
  1148. //    if (printing == "TRUE") return;
  1149.  
  1150.     oImg.src = expand;
  1151.     oExpandable.style.display = "block";
  1152.     
  1153. //    if (!redo && !isIE5) {
  1154. //        redo = true;
  1155. //        focus(oToExpand);
  1156. //        doExpand(oToExpand, oToChange);
  1157. //        }
  1158.     }
  1159.  
  1160.  
  1161. //****  doCollapse *****************************************************************************************************
  1162. //  Collapses expandable block & changes image
  1163.     
  1164. function doCollapse(oToCollapse, oToChange) {
  1165. // if (printing == "TRUE") return;
  1166. var oExpandable= oToCollapse;
  1167. var oImg= oToChange;
  1168.  
  1169.     oExpandable.style.display = "none";
  1170.     oImg.src = closed;
  1171. }
  1172.  
  1173. //*******************************************************************************************************
  1174. //******* WEB  FUNCTIONS **************************************************************************
  1175. //*******************************************************************************************************
  1176.  
  1177. //**** callThumbnailWeb **************************************************************************************
  1178.  
  1179. function callThumbnailWeb(eventSrc) {
  1180. var e= eventSrc;
  1181.        event.returnValue = false;
  1182.                     
  1183. var thumbnailWin= window.open (e.href, "$global_largeart",  "height=450, width=600, left=10, top=10, dependent=yes, resizable=yes, status=no, directories=no, titlebar=no, toolbar=yes, menubar=no, location=no","true");
  1184.  
  1185. thumbnailWin.document.write ("<html><head><title>Windows 2000</title></head><body><img src='"+e.href+"'></body></html>");
  1186.  
  1187. return;
  1188. }
  1189.  
  1190. //*********************************************************************************************************
  1191. //*********************************************************************************************************
  1192.                                 
  1193. var popupOpen= false;                //state of popups
  1194. var posX, posY;                        //coordinates of popups
  1195. var oPopup;                            //object to be used as popup content
  1196.  
  1197. //**** callPopupWeb **************************************************************************************
  1198. // the web popups have been converted from the object winHelp popup for the web.
  1199. // called by: <A ID="wPopupWeb" HREF="#">@@Popup text@@</A>
  1200. // followed by: <div class="popup">Popup content</div>
  1201.  
  1202.  
  1203. function callPopupWeb(eventSrc) {
  1204. var e= eventSrc;
  1205.   
  1206.   // find the popup <div> that follows <a id="wPopupWeb"></a>
  1207.   findPopup(e);
  1208.   positionPopup(e)
  1209.  
  1210.   oPopup.style.visibility = "visible";
  1211.   // document.focus(e)
  1212.   popupOpen = true;
  1213.  
  1214.   return;
  1215. }
  1216.  
  1217. //**** findPopup ****************************************************************************************
  1218.  
  1219. function findPopup(oX){
  1220. var e= oX;
  1221. var iNextTag;
  1222.     
  1223.     for (var i=1;i<document.all.length; i++){
  1224.          iNextTag=    e.sourceIndex + i;
  1225.          oPopup= document.all(iNextTag);
  1226.          if (oPopup.className.toLowerCase()=="popup" || iNextTag == document.all.length)
  1227.              break;
  1228.     }
  1229.     
  1230.     if (iNextTag != document.all.length) {
  1231.         posX = window.event.clientX; 
  1232.         posY = window.event.clientY + document.body.scrollTop+10;
  1233.     }
  1234.     if (popupOpen) closePopup();
  1235. }
  1236.  
  1237.  
  1238. //****  positionPopup ************************************************************************************
  1239. // Set size and position of popup.
  1240. // If it is off the page, move up, but not past the very top of the page.
  1241.  
  1242. function positionPopup(oX){
  1243. var e= oX;    
  1244. var popupOffsetWidth = oPopup.offsetWidth;
  1245.  
  1246. //determine if popup will be offscreen to right
  1247. var rightlimit = posX + popupOffsetWidth;
  1248.  
  1249.   if (rightlimit >= document.body.clientWidth) 
  1250.       posX -= (rightlimit - document.body.clientWidth);
  1251.   if (posX < 0) posX = 0;
  1252.     
  1253. //position popup
  1254.   oPopup.style.top = posY;
  1255.   oPopup.style.left = posX;
  1256.  
  1257. var pageBottom = document.body.scrollTop + document.body.clientHeight;
  1258. var popupHeight = oPopup.offsetHeight;
  1259.   
  1260.   if (popupHeight + posY >= pageBottom) {
  1261.       if (popupHeight <= document.body.clientHeight)
  1262.           oPopup.style.top = pageBottom - popupHeight;
  1263.       else
  1264.            oPopup.style.top = document.body.scrollTop;
  1265.   }
  1266. }
  1267.  
  1268. //**** closePopup ****************************************************************************************
  1269. // Close Popup
  1270. function closePopup() {
  1271.  
  1272.   oPopup.style.visibility = "hidden";
  1273.   popupOpen = false;
  1274.   return;
  1275. }
  1276.  
  1277.  
  1278. //*********************************************  GENERAL FUNCTIONS ************************************************
  1279. //**************************************************************************************************************************
  1280.  
  1281. //***ajustImg *************************************************************************************************************
  1282. // expands an image to the with of the window or shrinks it to 90px
  1283.  
  1284. function ajustImg(eventSrc) {
  1285. var e= eventSrc;
  1286. var fullWidth= document.body.offsetWidth;
  1287.  
  1288.     fullWidth = fullWidth - 50;
  1289.     if (e.style.pixelWidth==90)
  1290.          e.style.pixelWidth=fullWidth;
  1291.     else e.style.pixelWidth=90;
  1292. }
  1293.  
  1294.  
  1295. //**  getURL **************************************[used in callShortcut, popNewWindow& loadPage]********
  1296. // extracts the file location (CHM::/HTM) URL 
  1297.  
  1298. function getURL(sHREF) {
  1299. var spaces= /\s/g
  1300. var eH = unescape(sHREF);
  1301.     eH = eH.replace(spaces,""); 
  1302.  
  1303. var eH_= eH.toLowerCase();
  1304. var sParamFILE= "";
  1305. var sParamCHM= "";
  1306.  
  1307. var iFILE= eH_.lastIndexOf("file=");
  1308.     if (iFILE!=-1){
  1309.         iEND= iFILE +1;
  1310.         sParamFILE = eH.substring(iFILE+5,eH.length);
  1311.     }
  1312.  
  1313. var iCHM  = eH_.lastIndexOf("chm=");
  1314.      
  1315. if (gifwithin){
  1316.     gifwithin = false;
  1317.     var con_mmc;
  1318.     var doc_mmc;
  1319.     doc_mmc = " " + document.location;
  1320.     doc_mmc = doc_mmc.toLowerCase();
  1321.     if (iCHM!=-1){
  1322.         iEND  = iCHM +1;                             // iEND used by callShortcut
  1323.         sParamCHM = eH.substring(iCHM+4, iFILE);
  1324.         con_mmc = doc_mmc.indexOf(sParamCHM);
  1325.             if (con_mmc != -1){
  1326.                 sParamCHM = "";
  1327.                 iCHM = -1;
  1328.             sParamFILE= moniker + sParamCHM+sParamFILE;    
  1329.             }
  1330.         }
  1331.     }
  1332.  
  1333.      if (iCHM!=-1){
  1334.         iEND  = iCHM +1;                             // iEND used by callShortcut
  1335.         sParamCHM = eH.substring(iCHM+4, iFILE);
  1336.         sParamFILE= moniker + sParamCHM+"::/"+sParamFILE;    
  1337.         }
  1338.     if (sParamFILE == "") sParamFILE = unescape(sHREF);
  1339.         
  1340.     return sParamFILE;
  1341. }
  1342. //****************************************************************************************************************************
  1343. //********************************************  IE5 PERSISTENCE  *************************************************************
  1344. //****************************************************************************************************************************
  1345.  
  1346. var oTD,iTD;         // persistence
  1347.  
  1348. //****** Persistence for userData ********************************************************************************************* 
  1349.  
  1350. function getChecklistState(){ 
  1351.  
  1352.  var pageID= addID();
  1353.  
  1354.     if (checklist.all== "[object]") {
  1355.     oTD=checklist.all.tags("INPUT");
  1356.     iTD= oTD.length;
  1357.         }
  1358.     else
  1359.         {
  1360.         printing = "TRUE";
  1361.         isPersistent = false;
  1362.         return;
  1363.         }
  1364.  
  1365.     if (iTD == 0){
  1366.         printing = "TRUE";
  1367.         isPersistent = false;
  1368.         return;
  1369.         }
  1370.     
  1371. // routine added to fix a bug in the ocx 06/14/99    
  1372.      lct = document.location + ".";
  1373.      xax = 10;
  1374.      xax = lct.indexOf("mk:@MSITStore");
  1375.      if (xax != -1) {
  1376.          lct = "ms-its:" + lct.substring(14,lct.length-1);
  1377.         // alert("before reload : " + document.location);
  1378.         // alert("replace with : " + lct);
  1379.         isPersistent = false;
  1380.         document.location.replace(lct);
  1381.         isPersistent = true;
  1382.         // alert("after reload : " + document.location);
  1383.         }     
  1384.      else
  1385.          {      
  1386.          checklist.load("oXMLStore");
  1387.         }
  1388. // routine added to fix a bug in the ocx 06/14/99
  1389.     if (checklist.getAttribute("sPersist"+pageID+"0"))    
  1390.     for (i=0; i<iTD; i++){
  1391.  
  1392.          if (oTD[i].type =="checkbox" || oTD[i].type =="radio"){
  1393.          checkboxValue= checklist.getAttribute("sPersist"+pageID+i);
  1394.         
  1395.          if (checkboxValue=="yes") oTD[i].checked=true;
  1396.          else oTD[i].checked=false;
  1397.          }// if
  1398.          if (oTD[i].type =="text")              
  1399.               oTD[i].value= checklist.getAttribute("sPersist"+pageID+i);
  1400.      }// for
  1401. } // end persistence
  1402.  
  1403. //**  saveChecklistState *************************************************************************************************************
  1404. function saveChecklistState(){
  1405. var pageID= addID(); 
  1406.  
  1407.         if (!isPersistent) return; 
  1408.          //  you will need this           document.location
  1409.         for (i=0; i<iTD; i++){
  1410.  
  1411.                 if (oTD[i].type =="checkbox" || oTD[i].type =="radio"){
  1412.                  if (oTD[i].checked) checkboxValue="yes";
  1413.                  else checkboxValue="no";
  1414.                  
  1415.                  checklist.setAttribute("sPersist"+pageID+i, checkboxValue);
  1416.              }// if
  1417.             
  1418.               if (oTD[i].type =="text") 
  1419.                  checklist.setAttribute("sPersist"+pageID+i, oTD[i].value);
  1420.          }    // for
  1421.  
  1422.  // routine added to fix a bug in the ocx 06/14/99    
  1423.      lct = document.location + ".";
  1424.      xax = 10;
  1425.      xax = lct.indexOf("mk:@MSITStore");
  1426.      if (xax != -1) {
  1427.          lct = "ms-its:" + lct.substring(14,lct.length-1);
  1428.         // alert("before reload : " + document.location);
  1429.         // alert("replace with : " + lct);
  1430.         isPersistent = false;
  1431.         document.location.replace(lct);
  1432.         isPersistent = true;
  1433.         // alert("after reload : " + document.location);
  1434.         }     
  1435.      else
  1436.          {      
  1437.          checklist.save("oXMLStore");
  1438.         }
  1439. // routine added to fix a bug in the ocx 06/14/99
  1440.      
  1441. }//end function
  1442.  
  1443. //**  resizeDiv *******************************[used with callPopupWeb, setPreviousNext}****************************************************
  1444. //  resize the page when the <div class=nav></div> && <div class=text></div> are found
  1445. function resizeDiv(){
  1446. if (printing == "TRUE") return;
  1447. var oNav = document.all.item("nav");
  1448. var oText= document.all.item("text");
  1449.  
  1450.     if (popupOpen) closePopup();
  1451.     if (oText == null) return;
  1452.     if (oNav != null){
  1453.         document.all.nav.style.width= document.body.offsetWidth;
  1454.         document.all.text.style.width= document.body.offsetWidth-4;
  1455.         document.all.text.style.top= document.all.nav.offsetHeight;
  1456.         if (document.body.offsetHeight > document.all.nav.offsetHeight)
  1457.             document.all.text.style.height= document.body.offsetHeight - document.all.nav.offsetHeight;
  1458.          else document.all.text.style.height=0; 
  1459.   }
  1460. }
  1461. //**  addID *************************************************************************************************************
  1462. function addID(){
  1463.  
  1464. var locID = document.location.href; 
  1465. var iHTM = locID.lastIndexOf(".htm");
  1466. var iName=locID.lastIndexOf("/");
  1467.       locID = locID.substring(iName+1,iHTM);
  1468.     
  1469.     return locID;
  1470. }    
  1471. //** set_to_print ***************
  1472. function set_to_print(){
  1473.     
  1474.     var i;
  1475.     printing = "TRUE";
  1476.  
  1477.  
  1478.  
  1479. // trying    
  1480.  isPersistent= (document.all.item("checklist")!=null) && ((isIE5) || (isIE6));
  1481.  setPreviousNext();
  1482.  resizeDiv();
  1483.  if (isPersistent) getChecklistState();
  1484. // addReusableText();
  1485.  if (isIE55){
  1486.       insertImages();
  1487.      }
  1488. if (isIE6){
  1489.       insertImages();
  1490.      }
  1491.  
  1492. // to fix printing
  1493.  
  1494.  
  1495.     if (window.text) {
  1496.         if (!window.text.style){
  1497.             scroller = "FALSE";
  1498.             }
  1499.         else
  1500.             {
  1501.             document.all.text.style.height = "auto";
  1502.             scroller = "TRUE";
  1503.             }
  1504.         }
  1505.     
  1506. var thisLoc= document.location.href;
  1507.     thisLoc = thisLoc.indexOf("glossary.htm")
  1508.     if (thisLoc == -1){
  1509.         return;
  1510.         }
  1511.     
  1512.     // if(!isIE55 || !isIE6){
  1513.     for (i=0; i < document.all.length; i++){
  1514.         if (document.all[i].id == "expand") {
  1515.             callExpand(document.all[i]);
  1516.             single = "TRUE";
  1517.             }
  1518.         if (document.all[i].tagName == "BODY") {
  1519.             document.all[i].scroll = "auto";
  1520.             }
  1521.         if (document.all[i].tagName == "A" && scroller != "TRUE") {
  1522.             joe = " " + document.all[i].outerHTML
  1523.             joe = joe.toLowerCase();
  1524.             joe = joe.indexOf("href=")
  1525.             if(joe == -1){
  1526.                 document.all[i].outerHTML = "<A NAME=''>" + document.all[i].innerHTML + "</a>";
  1527.                 }
  1528.             else
  1529.                 {
  1530.                 document.all[i].outerHTML = "<A HREF=''>" + document.all[i].innerHTML + "</a>";
  1531.                 }
  1532.             }
  1533.         }
  1534.         //}
  1535. // reset_form();
  1536.     
  1537. }
  1538. //** used to reset a page if needed ********************
  1539. function reset_form(){
  1540.     printing = "FALSE";
  1541.     document.location.reload();
  1542. }
  1543.  
  1544.     
  1545. //** on error routine *********************************
  1546. function errorHandler() {
  1547.   // alert("Error Handled");
  1548.   return true;
  1549. }
  1550.  
  1551. //** quad method code --  Witten by Randy Feinger, morphed to work inside of shared.js
  1552. function QuadDocumentMouseOver()
  1553. {
  1554.     var elem = event.srcElement;
  1555.     
  1556.     // If the first childe of the source element is a radio button and 
  1557.     // the parent element isn't grayed, change the cursor to a hand
  1558.     // or back to the original as appropriate.
  1559.     if (elem != null && elem.firstChild != null && 
  1560.         elem.firstChild.tagName != null &&
  1561.         elem.firstChild.tagName.toLowerCase() == "input" && 
  1562.         elem.firstChild.type.toLowerCase() == "radio" && 
  1563.         elem.parentElement.className != "indentGray")
  1564.     {
  1565.         if (elem.style.cursor == "hand")
  1566.             elem.style.cursor = "auto";
  1567.         else
  1568.             elem.style.cursor = "hand";
  1569.     }
  1570. }
  1571.  
  1572. function QuadDocumentClick()
  1573. {
  1574.     // Don't process clicks on grayed text.
  1575.     if (event.srcElement.parentElement.className == "indentGray")
  1576.         return;
  1577.     
  1578.     // INPUT elements should be wrapped by another element such as a SPAN, DIV, or P.
  1579.     var elem = event.srcElement.firstChild;
  1580.     
  1581.     // If this is a radio button...
  1582.     if (elem != null && elem.tagName != null && elem.tagName.toLowerCase() == "input" && elem.type == "radio")
  1583.     {
  1584.         // check it.
  1585.         elem.checked = true;
  1586.     }
  1587.     else
  1588.     {    
  1589.         // Otherwise, set elem to the event's source element.
  1590.         elem = event.srcElement;
  1591.     }
  1592.     
  1593.     // Call OnElementClick() and pass in the source element, and the name token
  1594.     // used to mark a top-level clickable element such as a radio button.
  1595.     OnElementClick(elem, "row1");
  1596. }
  1597.  
  1598. function OnElementClick(srcElem, token)
  1599. {
  1600.     var elemTagName = srcElem.tagName;                        // Tag name of the source element.
  1601.     var collElements1 = document.all.item(srcElem.name);    // Collection of elements with the same name property as the source element.
  1602.     var n = srcElem.sourceIndex;                            // The source index of the source element.
  1603.     var elemGroup = srcElem.group;                            // The (dynamic) group property for the source element.
  1604.     var elemID = srcElem.id;                                // The source element's ID.
  1605.     var i, j, k;                                            // Loop variables.
  1606.     
  1607.     // If there are no elements with the same name as the source element, or
  1608.     // if the source element isn't part of a group, exit the function.
  1609.     if (collElements1 == null || elemGroup == null || collElements1.length == null)
  1610.         return;
  1611.     
  1612.     // Make sure the source element's name contains the designated token
  1613.     // so we know it's top-level element that should be processed.
  1614.     if (srcElem.name.toLowerCase().indexOf(token) != -1)
  1615.     {
  1616.         // Loop through the collection of 
  1617.         for (i = 0; i < collElements1.length; i++)
  1618.         {
  1619.             // Go up one level and then down a level in the element hierarchy to find
  1620.             // the container (parent) element for the clickable sub-elements (radio buttons).
  1621.             var oNextElement = collElements1(i).parentElement.nextSibling;
  1622.             
  1623.             // If there is no such element, get the next element in the collection.
  1624.             if (oNextElement == null || oNextElement.tagName == null)
  1625.                 continue;
  1626.             
  1627.             // Get the collection of all the elements within the container element that 
  1628.             // have the same tag name as the source element.
  1629.             var collElements2 = oNextElement.all.tags(elemTagName);
  1630.             
  1631.             // Make sure the collection is valid.
  1632.             if (collElements2 == null || collElements2.length == 0)
  1633.                 continue;
  1634.  
  1635.             // Loop through the collection of sub-elements within the container element.
  1636.             for (j = 0; j < collElements2.length; j++)
  1637.             {
  1638.                 // If the current element in the collection is not the
  1639.                 // source element, disable it and make the text gray.
  1640.                 if (collElements1(i).sourceIndex != n)
  1641.                 {
  1642.                     oNextElement.className = "indentGray"
  1643.                     collElements2(j).disabled = true;
  1644.                 }
  1645.                 else    // Otherwise, enable the element and make the text black.
  1646.                 {
  1647.                     oNextElement.className = "indentBlack"
  1648.                     collElements2(j).disabled = false;
  1649.                     
  1650.                     // Set the ID for the checked (selected) element for use below.
  1651.                     if (collElements2(j).tagName.toLowerCase() == "input" && 
  1652.                         collElements2(j).type.toLowerCase() == "radio" && 
  1653.                         collElements2(j).checked == true)
  1654.                     {
  1655.                         elemID = collElements2(j).id;
  1656.                     }
  1657.                 }
  1658.             }
  1659.         }
  1660.     }
  1661.     
  1662.     // Get the collection of all of the elements with the same tag name as that
  1663.     // of the source element.
  1664.     var collElements2 = document.all.tags(elemTagName);
  1665.         
  1666.     // Make sure the collection is valid.
  1667.     if (collElements2 == null || collElements2.length == 0)
  1668.         return;
  1669.         
  1670.     // Loop through the collection of elements.
  1671.     for (i = 0; i < collElements2.length; i++)
  1672.     {
  1673.         // Get the collection of all elements with the same ID as the
  1674.         // current item in the collection.
  1675.         var collAssocElems = document.all(collElements2(i).id);
  1676.                 
  1677.         // Make sure the collection is valid.
  1678.         if (collAssocElems == null || collAssocElems.length == 0)
  1679.             continue;
  1680.             
  1681.         // Loop through the collection of same-named elements.
  1682.         for (j = 0; j < collAssocElems.length; j++)
  1683.         {
  1684.             // If the tag name for the current element is different than that for the source element,
  1685.             // and the current element is part of the same group as the source element, 
  1686.             // hide or display the element as appropriate.
  1687.             if (collAssocElems(j).tagName != elemTagName && collAssocElems(j).group == elemGroup)
  1688.             {
  1689.                 // Hide the element unless the current element's ID matches the ID of the element
  1690.                 // that has been checked (selected).
  1691.                 collAssocElems(j).style.display = ((collAssocElems(j).id == elemID) ? "block" : "none")
  1692.             }
  1693.         }
  1694.     }
  1695. }
  1696.  
  1697.